package com.fengxu.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
// 可根据config服务端读取到的配置文件的变更动态的刷新controller
@RefreshScope
public class ConfigClientController {

    // 这里的是从config服务器上读取到配置文件中配置的config.info
    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/info")
    public String configInfo(){
        return configInfo;
    }
}
